home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 18 / CU Amiga Magazine's Super CD-ROM 18 (1997)(EMAP Images)(GB)[!][issue 1998-01].iso / CUCD / Programming / AmigaE / Src / OOmodules / list / execlist / test.e < prev   
Encoding:
Text File  |  1996-09-19  |  1.2 KB  |  65 lines

  1. /*
  2.  
  3. Sample program for the execlist object. It allocates an execlist and
  4. displays its contents in a Listview gadgets via EasyGUI.
  5.  
  6. */
  7.  
  8. MODULE  'oomodules/list/execlist',
  9.         'tools/easygui'
  10.  
  11. PROC main() HANDLE
  12.  
  13.  /*
  14.   * Call the proc that opens a windows with the title 'huhu'
  15.   */
  16.  
  17.   showList(NIL,'huhu')
  18.  
  19.  
  20.  
  21.  /*
  22.   * If something went wrong we are here
  23.   */
  24.  
  25. EXCEPT
  26.   WriteF('exception raised\n')
  27. ENDPROC
  28.  
  29.  
  30.  
  31. PROC showList(list, title)
  32. DEF execlist:PTR TO execlist
  33.  
  34.  /*
  35.   * Allocate the object and set the list two the four entries.
  36.   * Since the "list" tag takes any E list we could use the elist
  37.   * object when we want to have a dynamic list (see there).
  38.   */
  39.  
  40.   NEW execlist.new(["list", ['1','two','tres','vier']])
  41.  
  42.  
  43.  
  44.  /*
  45.   * Tell EasyGUI to open a window with a listview gadget. A listview
  46.   * gadget takes the entries to display from an exec list - each node
  47.   * of the list is an entry. That exec list can be retrieved from the
  48.   * execlist object be specifying the list attribute.
  49.   */
  50.  
  51.   easygui(title,
  52.             [EQROWS,
  53.               [LISTV,NIL,NIL,30,10,execlist.list,0,0,0],
  54.               [BUTTON,NIL,'None']
  55.             ])
  56.  
  57.  
  58.  /*
  59.   * Be friendly and END the object.
  60.   */
  61.  
  62.   END execlist
  63.  
  64. ENDPROC
  65.